# -*- coding: utf-8 -*-

"""
 (c) 2023 - Copyright CTyunOS Inc

 Authors:
   youyifeng <youyf2@chinatelecom.cn>

"""

from .base import DBModel
from sqlalchemy import Column
from sqlalchemy import Text
from sqlalchemy import Integer


class RPM(DBModel):
    __tablename__ = 'RPM'
    id = Column('id', Integer, primary_key=True)

    # src.rpm split
    sourcerpm = Column('sourcerpm', Text)
    sname = Column('sname', Text)
    sver = Column('sver', Text)
    srel = Column('srel', Text)
    sepoch = Column('sepoch', Text)
    sarch = Column('sarch', Text)

    # bin rpm split
    rpmname = Column('rpmname', Text)
    name = Column('name', Text)
    ver = Column('ver', Text)
    rel = Column('rel', Text)
    epoch = Column('epoch', Text)
    arch = Column('arch', Text)

    # location like Packages/cmake-rpm-macros-3.16.5-4.oe1.noarch.rpm
    location = Column('location', Text)

    # pull path of rpm
    downloadurl = Column('downloadurl', Text)
    # os release
    product = Column('product', Text)


class SRPM(DBModel):
    __tablename__ = 'SRPM'
    id = Column('id', Integer, primary_key=True)
    sourcerpm = Column('sourcerpm', Text)
    sname = Column('sname', Text)
    sver = Column('sver', Text)
    srel = Column('srel', Text)
    sepoch = Column('sepoch', Text)
    sarch = Column('sarch', Text)

    # os release
    product = Column('product', Text)


